Skip to content

feat: add permalink to event API responses#944

Merged
dylanjeffers merged 2 commits into
mainfrom
feat/event-api-permalink
Jun 10, 2026
Merged

feat: add permalink to event API responses#944
dylanjeffers merged 2 commits into
mainfrom
feat/event-api-permalink

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Joins event_routes on event queries to expose permalink field in API responses. Adds migration 0218, updates GetEvents SQL and v1_events_remix_contests handler, seeds fixture data in tests.

dylanjeffers and others added 2 commits June 5, 2026 20:00
The /v1/events/entity endpoint returned only `data`, so every consumer that
resolves a contest through it had to fire a separate
`/tracks/{id}/remixes?only_contest_entries=true&limit=0` just to render the
entry-count badge. This is an N+1 on web Explore's featured contests (one
count request per card) and an extra round-trip on the track-page contest
section and cold/deep-linked contest pages.

Compute per-contest entry counts alongside the events query and return them
under `related.entry_counts`, keyed by the contest's parent track hashid —
mirroring the existing /events/remix-contests discovery endpoint so the client
can prime `useRemixesCount({ isContestEntry: true })` directly. The count uses
the same in-window filter (child track created after contest start, before
end_date, currently listed) and only applies to remix_contest events on track
entities.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Left-join event_routes on event queries to expose permalink field.
Adds migration 0218_create_event_routes.sql, updates GetEvents query
and v1_events_remix_contests handler, seeds fixture data in tests.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@dylanjeffers dylanjeffers merged commit 125e3fc into main Jun 10, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the feat/event-api-permalink branch June 10, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant